package com.gouying.design.patterns.prototype;

public class DbPrototypeMain {


    /**
     * 核心就是clone
     * @param args
     * @throws CloneNotSupportedException
     */
    public static void main(String[] args) throws CloneNotSupportedException {
        DB db = new DB();
        Animal select = db.select();

        select.setName("猫咪的徒弟");
        select.setType("老虎");
        System.out.println(select);

        Animal select1 = db.select();
        System.out.println(select1);
    }
}
